package org.example.springTask;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author liyishan
 * @date 2024/4/3 13:54
 * @apiNote 不支持分布式
 */
@Slf4j
@Component
//@EnableScheduling
public class ScheduledAnnotationExample {
    @Scheduled(fixedRate = 1000)
    public void printMessage() {
        log.info("hello timer");
    }

}
